import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import {
  Button, Icon, Tabbar, TabbarItem, Swipe, SwipeItem,
  Grid, GridItem, PullRefresh, List, NavBar,
  GoodsAction, GoodsActionIcon, GoodsActionButton, Popup,
  Card, Stepper, SwipeCell, Checkbox, Search, Lazyload,
  SubmitBar, ContactCard, ContactEdit, ContactList, AddressList, AddressEdit
} from 'vant'
import './assets/fonts/iconfont.css'
import axios from 'axios'
import img from './assets/imgs/loading.gif'
import $loading from './plugins/Loginding'
Vue.use($loading)
Vue.use(Button)
  .use(Icon)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Stepper)
  .use(SwipeCell)
  .use(Checkbox)
  .use(SubmitBar)
  .use(ContactCard)
  .use(ContactEdit)
  .use(ContactList)
  .use(AddressList)
  .use(AddressEdit)
  .use(Search)
  .use(Lazyload, {
    loading: img,
    error: img,
    preload: 1,
    attempt: 3
  })

Vue.config.productionTip = false
// 将axios这个请求放在实例的原型上，这样实例可以直接使用
Vue.prototype.$request = axios

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
